Connecting via PHP

The following example shows how to connect to the SQL Server via PHP.


<?php

$serverName = "mssql-xxxx-0.cloudclusters.net,xxxx";
$connectionInfo = array( "Database"=>"dbname", "UID"=>"dbuser", "PWD"=>"dbpass");
$conn = sqlsrv_connect( $serverName, $connectionInfo);

if( $conn ) {
     echo "Connection established.<br />";
}else{
     echo "Connection could not be established.<br />";
     die( print_r( sqlsrv_errors(), true));
}

?>
Copyright © 2021 Cloud Clusters Inc. all right reserved,powered by GitbookRevised on 11/07/2022

results matching ""

    No results matching ""